<?php
@$login = $_REQUEST['login'];

@$password = $_REQUEST['password'];

if(empty($login)||empty($password)){
	die(json_encode(array('status'=>false,'info'=>'登录名的密码都必须填写')));
}

require 'lib/db.php';

@$admin = dbSelect('select id,password from admin where login=:lgn',array('lgn'=>$login));

if(empty($admin)){
	die(json_encode(array('status'=>false,'info'=>'登录名不存在')));
}
if($password!=$admin['password']){
	die(json_encode(array('status'=>false,'info'=>'密码错误')));

}
session_start();

$_SESSION['adminID'] = $admin['id'];

die(json_encode(array('status'=>true,)));